﻿<!--#include file="rss_reader.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>RSS Reader Sample</title>
<meta name="Generator" content="EditPlus" />
<meta name="Author" content="Rami Kayyan" />
</head>

<body>
<table width="320" border="1" align="center">
<tr>
	<td align="center">
<%

' Example for reading RSS or RDF Site Summary files.
' The file is commented, to be as a simple manual as i hate to write manuals :)
' First thing to do is to include the rss reader file, as the first line above.


' First step is to create an instance of the class
	Set RSS = new kwRSS_reader

'	rssURL = "http://localhost/asp/fullxml/rss.asp"
	rssURL = "http://localhost/php/phpnuke/html/backend.php"
	rssURL = "http://localhost/php/postnuke/backend.php"

	rssURL = "http://localhost/asp/xml/test.xml"
	rssURL = "http://localhost/asp/cms/rss1.asp"
	
	
'	rssURL = "http://localhost/asp/fullxml/rss.asp"
'	rssURL = "http://localhost:88/phpnuke/backend.php"
	rssURL = "http://localhost/asp/cms/rss1.asp"
	rssURL = "http://localhost/asp/rss/write_rss.asp"
'	rssURL = "http://localhost/asp/rss/write_rss.asp?ver=1"

	rssURL = "http://www.misslog.com/blog/rss.asp?blog_id=6"
	
' Second step is to call the RSS parser with a valid RSS address.
' The address must be a full qualified internet address, not relative.
' Example on a valid address: http://www.kattanweb.com/webdev/rss.asp
	RSS.ParseLocation(rssURL)

' Here you can get the needed variables.
' Available variables are:
' 	ChannelRSSURI, ChannelURL, ChannelTitle, ChannelDesc, ChannelLanguage
'	ImageTitle, ImageLink, ImageURL
'	TextInputURL, TextInputTitle, TextInputDesc, TextInputName
' for more information about each variable are in the writer example "write_rss.asp

	Response.Write "<h3><a href=""" & RSS.ChannelURL & """ lang=""" & RSS.ChannelLanguage & """ title=""" & RSS.ChannelDesc & """>" & RSS.ChannelTitle & "</a></h3>"
	Response.Write "</td></tr><tr><td>"

' Some function available:
' [rss].FirstItem: will go to the first item in the rss file (not needed usually, as when the rss is parsed,
'                  the pointer will be on the first item.
' [rss].ValidItem: true/false according if the current item is a valid one (or exist)

	while not RSS.EOF
		' function available for items:
		' [rss].GetTitle: gets the title of the item
		' [rss].GetLink: gets the link of the item
		' [rss].GetDesc: gets the description of the item  	%>
		<a href="<% =RSS.GetLink %>" title="<% =Server.HTMLEncode(RSS.GetDesc) %>"><% =RSS.GetTitle %></a><br /> <% 
		
		' [rss].MoveNext: moves to the next item
		RSS.MoveNext
	wend

' [rss].GetTextInput: gets the textinput search box, using a simple table.
' if you don't want the default form, make your own one using the TextInputURL, TextInputTitle,
' TextInputDesc, TextInputName variables
if RSS.GetTextInput <> "" then
	Response.Write "</td></tr><tr><td align=""center"">"
	Response.Write RSS.GetTextInput
end if


' [rss].GetImage: gets the image with link (if available)
' if you don't want the default style, make your own one using the ImageTitle, ImageLink, ImageURL variables
if RSS.GetImage <> "" then
	Response.Write "</td></tr><tr><td align=""right"">"
	Response.Write RSS.GetImage
end if

' Setting RSS to nothing will free the memory 
Set RSS = nothing
%>
</td></tr>
</table>
</body>
</html>